package com.team.abs.controller;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import com.team.abs.dao.taskinsertImpl;
import com.team.abs.pojo.taskpojo;
import com.team.abs.service.uploadService;

@Controller
@RequestMapping("/pipi")
public class UserPage {
	@Autowired
	private  taskinsertImpl task;
	
	
	@RequestMapping("/home")
	public String home() {
		
		return "homePage";
	}
	//根据用户ID进行显示
	@RequestMapping("/home/{user}")
	public ModelAndView userhome(ModelAndView mv,
			@PathVariable (value="user")int user_id) {
		List<taskpojo>list=task.get_taskname_by_user_id(user_id);
		mv.addObject("item_data", list);
		mv.setViewName("homePage");
		return mv;}
	
}
